package com.example.bestudentsystem.demos.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.bestudentsystem.demos.web.pojo.Admin;
import com.example.bestudentsystem.demos.web.pojo.Course;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface AdminMapper extends BaseMapper<Admin> {
    @Select("SELECT * FROM course WHERE apply=1 ")
    List<Course> getPending();
    @Update("UPDATE course SET tno=#{tno},apply=#{apply},isopen=#{isopen} WHERE cname=#{cname}")
    void approve(String tno,int apply,int isopen,String cname);
    @Update("UPDATE course SET tno=#{tno},apply=#{apply},isopen=#{isopen} WHERE cname=#{cname}")
    void reject(String tno,int apply,int isopen,String cname);

}
